package com.example.jegotrip.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

import com.example.jegotrip.R;
import com.example.jegotrip.base.BaseActivity;
import com.example.jegotrip.db.NoteDBHelper;
import com.example.jegotrip.entity.NoteInfo;
import com.example.jegotrip.utils.CustomToast;

public class NoteDetailsActivity extends BaseActivity {
    private TextView de_note_title;
    private TextView de_note_content;
    private Button de_edit_note_button;

    private NoteInfo noteInfo;

    @Override
    protected void initData() {
//跳转传值
        noteInfo = (NoteInfo) getIntent().getSerializableExtra("noteInfo");
        if (noteInfo!= null){
            de_note_title.setText(noteInfo.getNote_title());
            de_note_content.setText(noteInfo.getNote_content());
        }
    }

    @Override
    protected void setListener() {
        findViewById(R.id.toolBar).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @Override
    protected void initViews() {
        de_note_title = findViewById(R.id.de_note_title);
        de_note_content = findViewById(R.id.de_note_content);
    }

    @Override
    protected int getLayoutResOId() {
        return R.layout.activity_note_details;
    }
}
